package indi.defoliation.unknownrpg.api.rpgevent.player;

import org.bukkit.block.Block;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;

public class PlayerClickEvent extends PlayerEvent{

	private Block block;
	private Entity entity;


	public PlayerClickEvent(Player what,Block block) {
		super(what);
		this.block=block;	
	}
	public PlayerClickEvent(Player what,Entity entity) {
		super(what);
		this.entity=entity;
	}

	public boolean clickInBlock() {
		if(block!=null)
			return !block.isEmpty();
		return false;
	}

	public boolean clickInEntity() {
		return entity!=null;
	}

	public boolean clickInAir() {
		if(block!=null)
			return block.isEmpty();
		return false;
	}
	
	public Block getClickBlock() {
		return this.block;
	}
	
	public Entity getClickEntity() {
		return this.entity;
	}

}
